//
//  JQAFNetworkTool.h
//  handworker
//
//  Created by dllo on 15/9/1.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, JQResult) {
    JQData,
    JQJSON,
    JQXML,
};
typedef NS_ENUM(NSUInteger, JQRequsetStyle) {
    JQRequestJSON,
    JQRequestString,
};
@interface JQAFNetworkTool : NSObject
/**
 *  Get请求
 *
 *  @param url        网络请求地址
 *  @param body       请求体
 *  @param result     返回数据类型
 *  @param headerFile 请求头
 *  @param success    网络请求成功回调
 *  @param failure    网络请求失败回调
 */
+ (void)getUrl:(NSString *)url
          body:(id)body
        result:(JQResult)result
    headerFile:(NSDictionary *)headerFile
       success:(void(^)(id result))success
       failure:(void(^)(NSError *error))failure;

+ (void)getUrl:(NSString *)url
       success:(void(^)(id result))success
       failure:(void(^)(NSError *error))failure;

+ (void)getUrl:(NSString *)url
       success:(void (^)(id result))success;
/**
 *  Post请求
 *
 *  @param url        网络请求地址
 *  @param body       请求体
 *  @param result     返回值的数据类型
 *  @param request    网络请求Body的类型
 *  @param headerFile 网络请求头
 *  @param success    成功回调
 *  @param failure    失败回调
 */

+ (void)postUrl:(NSString *)url
          body:(id)body
        result:(JQResult)result
        request:(JQRequsetStyle)request
    headerFile:(NSDictionary *)headerFile
       success:(void(^)(id result))success
       failure:(void(^)(NSError *error))failure;

//+ (void)refreshView:(UIScrollView *)scroVillew
//                url:(NSString *)url
//               page:(NSInteger)page
//              array:(NSArray *)array
//            success:(NSArray *(^)(id result))success;

@end
